/*
 * File:   Creature.h
 * Author: Elevator
 *
 * Created on 12 Май 2013 г., 23:42
 */

#ifndef CREATURE_H
#define CREATURE_H

#include <string>
#include "Common/Common.h"
#include "Core/Core.h"
#include "Command.h"
#include "IPart.h"

class Creature : public IEntity
{
public:
	Creature( std::string id );
	virtual ~Creature( );

	void AddPart( IPart* part );
	void RemovePart( IPart* part );
	void LinkParts( IPart* partA, IPart* partB );

	virtual std::string GetId( ) const;

	void ProcessCommand( const Command& command );

	virtual void Update( float dt );
	virtual void Draw( ) const;

	virtual const ICollection<IPart*>* GetParts( );
private:
	void RemovePartById( int id );

	std::string _id;
	Graph<IPart*> _parts;
	IPart* _head;
	int _partsCount;

};

#endif	/* CREATURE_H */

